package com.example.springbootjenkinxstest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class TestController {
    @Value("${server.port}")
    String port;

    @GetMapping("/")
    public String getProjectInfo(){
        return "这是SpringBoot3项目，用于测试Jenkins拉去代码并打包运行";
    }

    @GetMapping("/port")
    public String getServerPort(){
        return "该项目的服务端口是："+port;
    }
}
